<?php $this->headTitle()->append('Posiciones'); ?>

<table class="fixture" style="width:600px !important;">	
<?php IF($this->data[0]): ?>	 		
	<thead>
		<tr>
			<th colspan="4">
				Posiciones
			</th>
		</tr>
		<tr>			
			<td class="l" >Posici&oacute;n</td>		
			<td class="l" >Usuario</td>			
			<td class="l"> Pa&iacute;s</td>
			<td class="c" >Puntos</td>		
	

		</tr>
	</thead>
	
	<?php 
		$parity='odd'; 
		$position = 0;
		$puntos_anterior = -1;
	?>
	
	<tbody>
	
	<?php FOREACH($this->data as $key=>$row): ?>	
		
		<tr  class="<?= $parity ?>" <?php IF($row['mi_usuario']): ?>style="height:30px; color:green; font-weight:bold;" <? ENDIF ?>>
			<td class="l"><?php  if($row['puntos'] != $puntos_anterior){ $position++; $puntos_anterior = $row['puntos']; }?><?= $position ?></td>
 			<td class="l"><?= $row['alias'] ?></td>
			<td class="l"><img class="flagSmall" width="19" height="13" src="<?= auto_version('/assets/img/country-flags/'.$row['bandera'].'.png') ?>" alt="<?= $row['short_name'] ?>"></td>
 			<td class="c"><?= $row['puntos'] ?></td>
		</tr>
	
		<?php $parity = ($parity=='odd')?'even':'odd';?>	
		<?php ENDFOREACH ?>

	</tbody>
<?php ELSE: ?>
	<thead>
		<tr>
			<th colspan="4">
				No hay puntajes registrados para esta penca.
			</th>
		</tr>
	</thead>
<?php ENDIF ?>
</table>
